﻿<!--#include file="h.asp"--><%
'
'	七色虎建站系统
'	在线会员页面
'	2011.2.1

Sub main
	Dim sex,str,sexstr,body_,id,rs,sql
	Dim count,pagecount,page,i,pagesize,pagenum
	sex=getN("sex",0)
	Select Case sex
		Case 0:
			sex=""
			sexstr=""
			str=hu.url("bbs_online.asp?sex=1","帅哥")&"."&hu.url("bbs_online.asp?sex=2","美女")
		Case 1:
			sex="and sex=1"
			str= hu.url("bbs_online.asp","全部")&"."&hu.url("bbs_online.asp?sex=2","美女")
			sexstr="男"
		Case 2:
			sex="and sex=2"
			str=hu.url("bbs_online.asp","全部")&"."&hu.url("bbs_online.asp?sex=1","帅哥")
			sexstr="女"
		Case Else:
			sex=""
			sexstr=""
			str=hu.url("bbs_online.asp?sex=1","帅哥")&"."&hu.url("bbs_online.asp?sex=2","美女")
	End Select
	pagesize=10
	page=getN("page",1)
	hu.title = "在线会员"
	body_ = checkMsg()'信息
	body_ = body_ & "[div=nav]-"&hu.url("?aid=index","首页")&"-在线会员-"& hu.url("bbs_users.asp","全部会员") &"[/div]"
	sql="select id,name,sex,remark from 74hu_user where (logtime>#"&dateadd("n", -20, time_now)&"#) "&sex&" order by logtime desc"
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.open sql, hu.db, 1, 1
	If Not rs.eof Then
		count = rs.recordcount
		body_ = body_ & "有"&count&"位"&sexstr&"会员在线."&str&"<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
				body_ = body_ & "[div=odd]"&(pagenum+i)&"."&hu.url("bbs_user.asp?id="&rs("id"), noubb(rs("name")) )&"["& getBbsSex(rs("sex")) &"][/div][div=even]"&getUserRemark(rs("remark")) &"[/div]"
			rs.movenext
		Next
		body_ = body_ & showPage("bbs_online.asp", "sex:"&sex, page, pagecount)
	Else
		body_ = body_ & "没有"&sexstr&"会员在线."&str&"<br/>"
	End If
	rs.close
	Set rs=Nothing
	hu.body = comUbb(body_)
End Sub

%>